//
//  FeedbackImageView.m
//  CoachsBook
//
//  Created by huiyong li on 2022/9/1.
//

#import "FeedbackImageView.h"
#import "LongCollectionViewFlowLayout.h"
#import "LongFeedbackImageCell.h"
#import "LongFeedbackCameraCell.h"
@implementation FeedbackImageView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}
-(void)CreateUI{
    self.backV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, (APPwidth - 62)/3.0+20)];
    self.backV.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.backV];
    
    LongCollectionViewFlowLayout *layout = [[LongCollectionViewFlowLayout alloc] initWithType:FeedbackImage];
    layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(16, 0, APPwidth-32, (APPwidth - 62)/3.0+20) collectionViewLayout:layout];
    collectionView.backgroundColor= [UIColor whiteColor];
    [collectionView registerClass:[LongFeedbackImageCell class] forCellWithReuseIdentifier:@"LongFeedbackImageCell"];
    [collectionView registerClass:[LongFeedbackCameraCell class] forCellWithReuseIdentifier:@"LongFeedbackCameraCell"];
    collectionView.bounces = NO;
    [self.backV addSubview:collectionView];
    self.myCollectionView =collectionView;
    
    
}

@end
